/*
 * AddTaskFolder.java
 *
 * Created on May 10, 2008, 12:04 PM
 */
package org.netbeans.cubeon.ui.taskfolder;

import javax.swing.ImageIcon;
import javax.swing.JButton;
import org.netbeans.cubeon.tasks.core.api.TaskFolder;
import org.openide.util.NbBundle;
import org.openide.util.ImageUtilities;

/**
 *
 * @author  Anuradha G
 */
public class AddTaskFolder extends javax.swing.JPanel {

    private TaskFolder parent;

    /** Creates new form AddTaskFolder */
    private AddTaskFolder(TaskFolder parent) {
        this.parent = parent;
        initComponents();
    }

    public String getFolderName() {
        return txtName.getText().trim();
    }

    public void setFolderName(String name) {
        txtName.setText(name);
    }

    public String getFolderDescription() {
        return txtDescription.getText().trim();
    }

    public void setFolderDiescription(String descriptions) {
        txtDescription.setText(descriptions);
    }

    public JButton getOKButton() {
        return ok;
    }

    public static AddTaskFolder createAddUI(TaskFolder parent) {
        final AddTaskFolder aetf = new AddTaskFolder(parent);
        aetf.lblMainHeader.setText(NbBundle.getMessage(AddTaskFolder.class, "LBL_UI_Add_Folder"));
        aetf.lblSubHeader.setText(NbBundle.getMessage(AddTaskFolder.class, "LBL_UI_Add_Folder_Description"));
        aetf.lblIcon.setIcon(new ImageIcon(ImageUtilities.loadImage("org/netbeans/cubeon/ui/folder_add.png")));

        return aetf;
    }

    public static AddTaskFolder createEditUI(TaskFolder parent) {
        final AddTaskFolder aetf = new AddTaskFolder(parent);
        aetf.lblMainHeader.setText(NbBundle.getMessage(AddTaskFolder.class, "LBL_UI_Edit_Folder"));
        aetf.lblSubHeader.setText(NbBundle.getMessage(AddTaskFolder.class, "LBL_UI_Edit_Folder_Description"));
        aetf.lblIcon.setIcon(new ImageIcon(ImageUtilities.loadImage("org/netbeans/cubeon/ui/folder_edit.png")));

        return aetf;
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        ok = new javax.swing.JButton();
        pnlHeader = new javax.swing.JPanel();
        lblMainHeader = new javax.swing.JLabel();
        lblSubHeader = new javax.swing.JLabel();
        lblIcon = new javax.swing.JLabel();
        lblName = new javax.swing.JLabel();
        txtName = new javax.swing.JTextField();
        lblDescription = new javax.swing.JLabel();
        scrPane = new javax.swing.JScrollPane();
        txtDescription = new javax.swing.JTextPane();

        ok.setText(NbBundle.getMessage(AddTaskFolder.class, "AddEditTaskFolder.OK.text")); // NOI18N

        pnlHeader.setBackground(new java.awt.Color(255, 255, 255));
        pnlHeader.setBorder(javax.swing.BorderFactory.createMatteBorder(0, 0, 1, 0, javax.swing.UIManager.getDefaults().getColor("tab_border")));

        lblMainHeader.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N
        lblMainHeader.setText("_Main Header_"); // NOI18N

        lblSubHeader.setText("_description_"); // NOI18N

        org.jdesktop.layout.GroupLayout pnlHeaderLayout = new org.jdesktop.layout.GroupLayout(pnlHeader);
        pnlHeader.setLayout(pnlHeaderLayout);
        pnlHeaderLayout.setHorizontalGroup(
            pnlHeaderLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(pnlHeaderLayout.createSequentialGroup()
                .addContainerGap()
                .add(pnlHeaderLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                    .add(pnlHeaderLayout.createSequentialGroup()
                        .add(lblMainHeader, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 267, Short.MAX_VALUE)
                        .add(45, 45, 45))
                    .add(pnlHeaderLayout.createSequentialGroup()
                        .add(10, 10, 10)
                        .add(lblSubHeader, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 296, Short.MAX_VALUE)
                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)))
                .add(lblIcon, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 18, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                .addContainerGap())
        );
        pnlHeaderLayout.setVerticalGroup(
            pnlHeaderLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(org.jdesktop.layout.GroupLayout.TRAILING, pnlHeaderLayout.createSequentialGroup()
                .add(pnlHeaderLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING)
                    .add(lblIcon, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .add(org.jdesktop.layout.GroupLayout.LEADING, pnlHeaderLayout.createSequentialGroup()
                        .addContainerGap()
                        .add(lblMainHeader)
                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .add(lblSubHeader)))
                .add(10, 10, 10))
        );

        lblName.setText(org.openide.util.NbBundle.getMessage(AddTaskFolder.class, "AddTaskFolder.lblName.text")); // NOI18N

        lblDescription.setText(org.openide.util.NbBundle.getMessage(AddTaskFolder.class, "AddTaskFolder.lblDescription.text")); // NOI18N

        scrPane.setViewportView(txtDescription);

        org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(this);
        this.setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(pnlHeader, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
            .add(layout.createSequentialGroup()
                .addContainerGap()
                .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                    .add(org.jdesktop.layout.GroupLayout.TRAILING, txtName, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 330, Short.MAX_VALUE)
                    .add(scrPane, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 330, Short.MAX_VALUE)
                    .add(lblName, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 330, Short.MAX_VALUE)
                    .add(lblDescription, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 330, Short.MAX_VALUE))
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(layout.createSequentialGroup()
                .add(pnlHeader, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                .add(lblName)
                .add(4, 4, 4)
                .add(txtName, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.UNRELATED)
                .add(lblDescription)
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                .add(scrPane, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 208, Short.MAX_VALUE)
                .addContainerGap())
        );
    }// </editor-fold>//GEN-END:initComponents
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JLabel lblDescription;
    private javax.swing.JLabel lblIcon;
    private javax.swing.JLabel lblMainHeader;
    private javax.swing.JLabel lblName;
    private javax.swing.JLabel lblSubHeader;
    private javax.swing.JButton ok;
    private javax.swing.JPanel pnlHeader;
    private javax.swing.JScrollPane scrPane;
    private javax.swing.JTextPane txtDescription;
    private javax.swing.JTextField txtName;
    // End of variables declaration//GEN-END:variables
}
